//
//  HLNormalArrowModel.m
//  s.
//
//  Created by fanshijian on 2022/9/5.
//  Copyright © 2022 J. All rights reserved.
//

#import "NormalArrowModel.h"

@implementation NormalArrowModel

- (instancetype)init {
    if (self = [super init]) {
        self.textAlignment = NSTextAlignmentLeft;
        self.right_textAlignment = NSTextAlignmentRight;
//        self.keyboardType = UIKeyboardTypeNumberPad;
        [super prepareLayout:kSize(kScreenWidth, 25)];
    }
    return self;
}

- (NSString *)idf {
    if (self.idfBlock) return self.idfBlock();
    return @"NormalArrowCell";
}

+ (NormalArrowModel *)createTitle:(id)title size:(CGSize)size hiddenArrow:(BOOL)hiddenArrow {
    return [self createTitle:title size:size hiddenArrow:hiddenArrow action:nil];
}

+ (NormalArrowModel *)createTitle:(id)title size:(CGSize)size hiddenArrow:(BOOL)hiddenArrow action:(NSDictionary *)action {
    return [self createTitle:title type:0 size:size cell:nil hiddenArrow:hiddenArrow action:action];
}

+ (NormalArrowModel *)createTitle:(id)title type:(NSInteger)type size:(CGSize)size hiddenArrow:(BOOL)hiddenArrow action:(NSDictionary *)action {
    return [self createTitle:title type:type size:size cell:nil hiddenArrow:hiddenArrow action:action];
}

+ (NormalArrowModel *)createTitle:(id)title type:(NSInteger)type size:(CGSize)size cell:(NSString *)cell hiddenArrow:(BOOL)hiddenArrow action:(NSDictionary *)action {
    NormalArrowModel *model = [[self class] new];
    model.title = title;
    model.type = type;
    model.layout.itemSize = size;
    model.action = action;
    model.type = type;
    model.hiddenArrow = hiddenArrow;
    if (cell) {
        model.idfBlock = ^NSString * _Nonnull{
            return cell;
        };
    }
    return model;
}

@end
